import Vue from 'vue'
import Vuex from 'vuex'
import createdpersistedstate from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [createdpersistedstate({
    reducer (data) {
      return {
        city_name: data.city_name,
        city_id: data.city_id,
        province_id: data.province_id
      }
    }
  })],
  state: {
    tabBarIsShow: true,
    province_id: 330,
    city_id: 330100000000,
    city_name: '杭州市'
  },
  mutations: {
    isshow (state) {
      console.log('show')
      state.tabBarIsShow = false
    },
    ishide (state) {
      console.log('hide')
      state.tabBarIsShow = true
    },
    city (state, city) {
      state.province_id = city.province_id
      state.city_id = city.city_id
      state.city_name = city.city_name
    }
  },
  actions: {
  },
  modules: {
  }
})
